The present invention relates to an electronic device having a power supply control function for a device connected to the electronic device through a communication means, such as a USB, which simultaneously performs data communication and supplies power, a control method for the electronic device, and a storage medium.
As a method of connecting a peripheral device to a PC (Personal Computer), a method using a USB (Universal Serial Bus) has been proposed and has become popular. In this method, a plurality of peripheral devices are connected to a personal computer by serial communication, and allows plug-and-play (the function of automatically recognizing a connection when a peripheral device is newly connected or disconnected), hot insertion (the function of allowing connection/disconnection while there is power to the system), and the function of supplying power. This method is designed to save the user the trouble of setting addresses and the like in establishing connection.
Connection using a USB requires attachment/detachment of a combination of a total of four wires, called a VBUS, i.e., a 5-V power line, GND line, and two signal lines D+ and Dxe2x88x92, by using a dedicated connector. The current value that can be supplied by this power supply is limited. More specifically, this current value is limited to 100 mA to 500 mA according to the USB standards. In addition, with the USB a peripheral device must be set in a suspend state in accordance with an instruction from the host. In this state, current consumption by the VBUS must be as small as 500 xcexcA. A resume instruction is used to restore from a suspend state.
In this case, a connection like the one shown in FIG. 3 is established between the USB and the peripheral devices. With the USB, a plurality of devices can be connected to one host. For them, a tree-like connection is defined, with the host always being at the top of the tree. That is, one host serves as a controller for all the devices, and branches are formed through devices called HUBs, thereby connecting peripheral devices to the host.
The following problems arise in this connection scheme. The following two types of devices are connected to the end portions of the tree: a self-powered device having a power supply unit by itself; and a bus-powered device that has no power supply unit and receives power through a power line included in a communication cable such as a USB.
According to the prior art described above, when a device having a small power capacity, such as a digital camera, serves as a host, and a bus-powered device whose power consumption exceeds the allowable power supply capacity of the host is connected to the host, the host instantaneously fails because power exceeding the allowable capacity is used by the connected device through the host.
The user therefore must connect a bus-powered device to a host upon checking how much power can be supplied from the host to the bus-powered device, and how much power is required for the bus-powered device to be connected.
The present invention has been made in consideration of the above problems, and has as its object to provide an electronic device which can establish connection between a host and a device to be connected thereto without any problem, a control method for the electronic device, and a storage medium.
In order to solve the above objects and achieve the above object, an electronic device according to the present invention is an electronic device capable of supplying power to a connected device through a connection terminal, comprising: acquisition means for acquiring information about power for the device through the connection terminal upon connection of the device; and restriction means for restricting supply of power to the device when it is determined on the basis of the information acquired by said acquisition means that power consumption of the connected device exceeds power supplied by said electronic device.
The electronic device according to the present invention is characterized by further comprising, switching means for switching between a first mode of allowing power to be supplied to the device with a first current value and a second mode of allowing power to be supplied to the device with a second current value smaller than the first current value, wherein said switching means switches to the second mode when it is determined on the basis of the information acquired by said acquisition means that power consumption of the connected device exceeds power supplied by said electronic device.
The electronic device according to the present invention is characterized by further comprising display means for displaying information indicating that supply of power to the device is restricted, when said restriction means restricts supply of power to the device.
The electronic device according to the present invention is characterized in that, wherein the restriction means does not restrict supply of power to the device when the electronic device is driven by an external power supply.
The electronic device according to the present invention is characterized by further comprising, monitoring means for monitoring a residual capacity of said electronic device, wherein said restriction means restricts supply of power to the device when said monitoring means determines that a power capacity of said electronic device is smaller than a predetermined amount while power is supplied to the device.
The electronic device according to the present invention is characterized in that, wherein the restriction means restricts supply of power to the device in accordance with an operation state of the electronic device while power is supplied to the device.
The electronic device according to the present invention is characterized in that wherein the electronic device is a portable electronic device having a limited power capacity.
The electronic device according to the present invention is characterized in that wherein said electronic device is an image sensing device.
A control method for an electronic device according to the present invention a control method for an electronic device capable of supplying power to a connected device through a connection terminal, comprising: the acquisition step of acquiring information about power for the device through the connection terminal upon connection of the device; and the restriction step of restricting supply of power to the device when it is determined on the basis of the information acquired in the acquisition step that power consumption of the connected device exceeds power supplied by the electronic device.
The control method for the electronic device according to the present invention is characterized by further comprising, the switching step of switching between a first mode of allowing power to be supplied to the device with a first current value and a second mode of allowing power to be supplied to the device with a second current value smaller than the first current value, wherein the switching step comprises switching to the second mode when it is determined on the basis of the information acquired in the acquisition step that power consumption of the connected device exceeds power supplied by the electronic device.
The control method for the electronic device according to the present invention is characterized by further comprising, the display step of displaying information indicating that supply of power to the device is restricted, when supply of power to the device is restricted in the restriction step.
The control method for the electronic device according to the present invention is characterized by further comprising, wherein the restriction step comprises imposing no restriction on supply of power to the device when the electronic device is driven by an external power supply.
The control method for the electronic device according to the present invention is characterized by further comprising, the monitoring step of monitoring a residual capacity of the electronic device, wherein the restriction step comprises restricting supply of power to the device when it is determined in the monitoring step that a power capacity of the electronic device is smaller than a predetermined amount while power is supplied to the device.
The control method for the electronic device according to the present invention is characterized in that, wherein the restriction step comprises restricting supply of power to the device in accordance with an operation state of the electronic device while power is supplied to the device.
A storage medium according to the present invention is a storage medium storing a control program for an electronic device capable of supplying power to a connected device through a connection terminal, the control program comprising: a code for the acquisition step of acquiring information about power for the device through the connection terminal upon connection of the device; and a code for the restriction step of restricting supply of power to the device when it is determined on the basis of the information acquired in the acquisition step that power consumption of the connected device exceeds power supplied by the electronic device.
The storage medium according to the present invention is characterized by further comprising a code for the switching step of switching between a first mode of allowing power to be supplied to the device with a first current value and a second mode of allowing power to be supplied to the device with a second current value smaller than the first current value, wherein the switching step comprises switching to the second mode when it is determined on the basis of the information acquired in the acquisition step that power consumption of the connected device exceeds power supplied by the electronic device.
The storage medium according to the present invention is characterized by further comprising a code for the display step of displaying information indicating that supply of power to the device is restricted, when supply of power to the device is restricted in the restriction step.
The storage medium according to the present invention is characterized in that wherein the restriction step comprises imposing no restriction on supply of power to the device when the electronic device is driven by an external power supply.
The storage medium according to the present invention is characterized by further comprising, a code for the monitoring step of monitoring a residual capacity of the electronic device, wherein the restriction step comprises restricting supply of power to the device when it is determined in the monitoring step that a power capacity of the electronic device is smaller than a predetermined amount while power is supplied to the device.
The storage medium according to the present invention is characterized in that wherein the restriction step comprises restricting supply of power to the device in accordance with an operation state of the electronic device while power is supplied to the device.
Other objects and advantages besides those discussed above shall be apparent to those skilled in the art from the description of a preferred embodiment of the invention which follows. In the description, reference is made to accompanying drawings, which form a part hereof, and which illustrate an example of the invention. Such example, however, is not exhaustive of the various embodiments of the invention, and therefore reference is made to the claims which follow the description for determining the scope of the invention.